﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace PowerArrow.nasa.View.Compont
{
	public partial class Num01 : UserControl
	{
		public Num01()
		{
			// Required to initialize variables
			InitializeComponent();
		}


        #region NumProperty
        public string Num
        {
            get { return (string)GetValue(NumProperty); }
            set { SetValue(NumProperty, value); }
        }
        public static readonly DependencyProperty NumProperty =
            DependencyProperty.Register("Num", typeof(string), typeof(Num01), new PropertyMetadata("11", OnNumPropertyChanged));

        private static void OnNumPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Num01 num01 = d as Num01;
            num01.NumChanged((string)e.NewValue);
        }

        private void NumChanged(string str)
        {
            num.Text = str;
            if (str == "11")
            {
                num.Visibility = Visibility.Collapsed;
                imgflower.Visibility = Visibility.Visible;
            }
            else
            {
                num.Visibility = Visibility.Visible;
                imgflower.Visibility = Visibility.Collapsed;        
            }
        }
        #endregion
	}
}